[#include "/app/common/layout/__backstagemainlayout.html"/]
[@mainlayout pageJavascript=pageJavascript pageCss=pageCss currentMenu="roleFlag-rolesListFlag"]
<div class="page-header">
	<h1>
		角色管理 
	</h1>
</div>
		<table class="table table-bordered table-hover">
			<thead>
				<tr>
					<th width="3%">角色编号</th>
					<th width="4%">角色名称</th>
					<th width="4%">角色代码</th>
					<th width="4%">父节点编号</th>
					<th width="5%">创建时间</th>
					<th width="3%">状态</th>
					<th width="8%">操作</th>
				</tr>
			</thead>
			<tbody>
				[#list roleTree as roles]
				<tr>
					<td>${(roles.id)!}</td>
					<td> ${(roles.name)!}</td>
					<td>${(roles.value)!}</td>
					<td>${(roles.pid)!}</td>
					<td>${(roles.created_at)!}</td>
					<td>
						<b>
						[#if roles.deleted_at??]
						<span class="red">禁用</span>
						[#else]
						<span class="gray">正常</span>
						[/#if]
						</b>
					</td>
					<td>
					<div class="action-buttons">
					<a class="btn btn-minier btn-primary btn-xs "  href="${ContextPath}/admin/role/edit?id=${(roles.id)!}" >编辑</a>
					<a class="btn btn-minier btn-primary btn-sm"   href="${ContextPath}/admin/role/assign?id=${(roles.id)!}"  >分配</a> 
					[#if roles.deleted_at??]
					<a class="btn btn-minier btn-danger btn-xs"  href="${ContextPath}/admin/role/on?id=${(roles.id)!}" >启用</a>
					[#else]
					<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/role/off?id=${(roles.id)!}" >禁用</a>
					[/#if]
					<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/role/add?id=${(roles.id)!}" >添加</a>
					</div>
					</td>
				</tr>
					[#list roles.children as role]
					<tr>
						<td>${(role.id)!}</td>
						<td><span class="glyphicon glyphicon-minus-sign"></span>     ${(role.name)!}</td>
						<td>${(role.value)!}</td>
						<td>${(role.pid)!}</td>
						<td>${(role.created_at)!}</td>
						<td>
							<b>
							[#if role.deleted_at??]
							<span class="red">禁用</span>
							[#else]
							<span class="gray">正常</span>
							[/#if]
							</b>
						</td>
						<td>
							<div class="action-buttons">
								<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/role/edit?id=${(role.id)!}" >编辑</a>
								<a class="btn btn-minier btn-primary btn-sm"   href="${ContextPath}/admin/role/assign?id=${(role.id)!}"  >分配</a>
								[#if role.deleted_at??]
								<a class="btn btn-minier btn-danger btn-xs"  href="${ContextPath}/admin/role/on?id=${(role.id)!}" >启用</a>
								[#else]
								<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/role/off?id=${(role.id)!}" >禁用</a>
								[/#if]
							</div>
						</td>
					</tr>
					[/#list]
				[/#list]
			</tbody>
		</table>
[/@mainlayout]